load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "transform",
    srcs = [
        "cache.go",
        "pending_job.go",
        "registry.go",
        "status.go",
        "transform.go",
        "transform.pb.go",
        "transform.pb.validate.go",
        "transform.pb.zap.go",
        "worker.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/server/worker/pipeline/transform",
    visibility = ["//visibility:public"],
    deps = [
        "//src/internal/backoff",
        "//src/internal/client",
        "//src/internal/collection",
        "//src/internal/errors",
        "//src/internal/errutil",
        "//src/internal/limit",
        "//src/internal/pachsql",
        "//src/internal/pctx",
        "//src/internal/pfssync",
        "//src/internal/ppsdb",
        "//src/internal/ppsutil",
        "//src/internal/storage/renew",
        "//src/internal/task",
        "//src/internal/uuid",
        "//src/pfs",
        "//src/pps",
        "//src/server/pfs",
        "//src/server/worker/common",
        "//src/server/worker/datum",
        "//src/server/worker/driver",
        "//src/server/worker/logs",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//reflect/protoreflect",
        "@org_golang_google_protobuf//runtime/protoimpl",
        "@org_golang_google_protobuf//types/known/anypb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_golang_x_sync//errgroup",
        "@org_uber_go_zap//zapcore",
    ],
)

go_test(
    name = "transform_test",
    srcs = [
        "common_test.go",
        "transform_test.go",
    ],
    pure = "on",
    deps = [
        ":transform",
        "//src/internal/backoff",
        "//src/internal/client",
        "//src/internal/collection",
        "//src/internal/dockertestenv",
        "//src/internal/errors",
        "//src/internal/obj",
        "//src/internal/pachconfig",
        "//src/internal/pachsql",
        "//src/internal/pctx",
        "//src/internal/ppsutil",
        "//src/internal/require",
        "//src/internal/tarutil",
        "//src/internal/task",
        "//src/internal/testpachd/realenv",
        "//src/internal/transactionenv/txncontext",
        "//src/pfs",
        "//src/pps",
        "//src/server/worker/common",
        "//src/server/worker/driver",
        "//src/server/worker/logs",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//types/known/emptypb",
        "@org_golang_x_sync//errgroup",
    ],
)

filegroup(
    name = "protos",
    srcs = glob(["*.proto"]),
    visibility = ["//src:__pkg__"],
)
